import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        isLogin: false,
        Authorization: localStorage.getItem('Authorization') ? localStorage.getItem('Authorization') : '',
        isPersonPage: false,
        fullScreen: false,
        writeAnswer: false,
        writeQuestion: false,
        questionInfo: {},
        userId: ''
    },
    mutations: {
        changeLogin(state, Authorization) {
            state.Authorization = Authorization
            state.isLogin = true
            localStorage.setItem('Authorization', Authorization)
        },
        changePersonPage(state, payload) {
            state.isPersonPage = payload;
        },
        changeFullScreen(state,payload) {
            state.fullScreen = payload
        },
        changeWriteAnswer(state,payload) {
            state.writeAnswer = payload
        },
        changeWriteQuestion(state,payload) {
            state.writeQuestion = payload
        },
        changeQuestionInfo(state,payload) {
            state.questionInfo = payload
        }
    },
    actions: {},
    modules: {}
})